import {Pipe, PipeTransform} from "@angular/core";
/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'timePeriodMonthType'})
export class TimePeriodMonthType implements PipeTransform {
    transform(value: any): string {
        let result: string = "-";
        for (let type of this.types) {
            if (type.value == value) {
                return type.name;
            }
        }
        return "未知"
    }

    constructor() {
        for (var i = 1; i < 32; i++) {
            this.types.push(
                {name: i + "号", value: i}
            )
        }
    }

    types: any = []


    getTypes(): any {
        return this.types
    }
}